<!DOCTYPE html>
<html lang="en">
<head>
<title>#(option.label)管理页面</title>
#@common()
</head>
<body class="no-skin">
	<div class="breadcrumbs" id="breadcrumbs">
		<ul class="breadcrumb">
			<li>
				<i class="ace-icon fa home-icon #(option.iconCols??'')"></i> 
				<a href="javascript:;">#(option.label)</a>
			</li>
		</ul>
	</div>
	<div class="page-body">
		<table id="tree-table"></table>
		<div id="grid-pager"></div>
	</div>

<script type="text/javascript">
var jqGrid;
$(function() {
	var option = {
		height : $(window).height() - 200,
		width : $(".page-body").width(),
		pager : "#grid-pager",
	};
	option.url = '#(table.url)';
	option.title = '#(table.label)';
	option.colNames = [];
	option.colModel = [];
	option.treeGrid = true;
	option.treeParent = "parentIdx";
	#for(col : cols)
	option.colNames.push('#(col.label)');
	option.colModel.push({"name" : '#(col.param)', "hidden": #(col.hidden), "key": #(col.key), #if(col.formatter??) formatter : #(col.url) #end})
	#end
	option['buttons'] = {
		#for(btn : btns)
		#if(btn.url == 'add') add : add, #end
		#if(btn.url == 'view') view : view, #end
		#if(btn.url == 'del') del : del, #end
		#if(btn.url == 'edit') edit : edit, #end
		#end
	};
	jqGrid = new JqGrid("#tree-table", option);
})

### 功能按钮的位置	
#for(btn : btns)
#(btn.formatter)
#end
		
### 表格列表功能部分的数据
#for(col : cols)
#if(col.formatter??)
#(col.formatter)
#end
#end
		
$(window).resize(function(){
	jqGrid.setWidth();
	jqGrid.setHeight();
})
</script>
</body>
</html>
